<template>
    <div id="statistics-school">
        <Title title="研学分析统计：学校"/>
        <div class="header">
            <div class="title">研学计划完成情况</div>
            <div>
                <el-cascader
                        v-model="value"
                        :options="options"
                        @change="handleChange"/>
            </div>
            <div>
                <el-cascader
                        v-model="value"
                        :options="options"
                        @change="handleChange"/>
            </div>
        </div>
        <div class="content-line1">
            <div class="progress-bar">
                <ProgressBar
                        size="60"
                        val="60"
                        text="60%"
                        bar-color="#54BFC1"
                        text-position="middle"
                        text-align="center"
                        font-size=20
                />
                <div class="text">
                    本学期研学计划完成进度
                </div>
            </div>
            <!--            本学年研学计划完成数-->
            <div class="complete-the-number">
                <div ref="lineChar" style="width: 1000px;height:300px;"></div>
                <div class="text">本学年研学计划完成数</div>
            </div>
        </div>
        <div class="content-line2">
            <!--            研学计划参与情况-->
            <div class="participation">
                <div class="title">研学计划完成情况</div>
                <div>
                    <el-cascader
                            v-model="value"
                            :options="options"
                            @change="handleChange"/>
                </div>
                <div>
                    <el-cascader
                            v-model="value"
                            :options="options"
                            @change="handleChange"/>
                </div>
            </div>
            <div calss="option">
                <el-radio v-model="radio" label="1">学校</el-radio>
                <el-radio v-model="radio" label="2">学生</el-radio>
            </div>
        </div>
        <div class="content-line3">
            <div>
                <div ref="pie" style="width: 300px;height:300px;"></div>
                <span class="title">参与研学计划数据</span>
            </div>
            <div class="coverage">
                <div class="coverage-item">
                    <div>
                        <el-progress type="circle" :percentage="25"/>
                    </div>
                    <div class="text">小学</div>
                    <div>
                        <el-progress type="circle" :percentage="25"/>
                    </div>
                    <div class="text">小学</div>
                    <div>
                        <el-progress type="circle" :percentage="25"/>
                    </div>
                    <div class="text">小学</div>
                </div>

                <div class="title">研学计划覆盖情况</div>
            </div>
        </div>
        <div class="content-line4">
            <div class="header">
                <div class="title">研学计划按区域完成情况</div>
                <div>
                    <el-cascader
                            v-model="value"
                            :options="options"
                            @change="handleChange"/>
                </div>
                <div>
                    <el-cascader
                            v-model="value"
                            :options="options"
                            @change="handleChange"/>
                </div>
            </div>
            <div class="chars">
                <div ref="lineChars" style="width: 1000px; height: 400px"></div>
            </div>
        </div>
        <div class="content-line5">
            <div class="header">
                <div class="title">按参与学生数排名前十的学校</div>
                <div>
                    <el-cascader
                            v-model="value"
                            :options="options"
                            @change="handleChange"/>
                </div>
                <div>
                    <el-cascader
                            v-model="value"
                            :options="options"
                            @change="handleChange"/>
                </div>
            </div>
            <div class="option option2">
                <el-radio v-model="radio" label="1">学校</el-radio>
                <el-radio v-model="radio" label="2">学生</el-radio>
                <el-radio v-model="radio" label="2">学生</el-radio>
            </div>
            <div class="chars">
                <div ref="acrossLineChar" style="width: 1000px; height: 500px"></div>
            </div>
        </div>
        <div class="content-line6">
            <AgGrid></AgGrid>
        </div>
    </div>
</template>

<script>
    import Title from "../../../../../components/title/Title";
    import {Cascader, Radio, Progress} from "element-ui";
    import ProgressBar from 'vue-simple-progress'
    import echarts from "echarts";
    import AgGrid from "../../../../../components/AgGrid/AgGrid";

    export default {
        name: "StatisticsSchool",
        components: {
            Title,
            ProgressBar,
            'el-cascader': Cascader,
            "el-radio": Radio,
            "el-progress": Progress,
            AgGrid
        },
        mounted() {
            const lineChar = this.$refs.lineChar;
            const myLineChar = echarts.init(lineChar);
            myLineChar.setOption(this.option);
            const pie = this.$refs.pie;
            console.log(pie);
            const myPie = echarts.init(pie);
            myPie.setOption(this.option2);
            const lineChars = this.$refs.lineChars;
            const myLineChars = echarts.init(lineChars);
            myLineChars.setOption(this.option3);
            const acrossLineChar = this.$refs.acrossLineChar;
            const myAcrossLineChar = echarts.init(acrossLineChar);
            myAcrossLineChar.setOption(this.option4);
        },
        data() {
            return {
                option4: {
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['2011年', '2012年']
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        boundaryGap: [0, 0.01]
                    },
                    yAxis: {
                        type: 'category',
                        data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)']
                    },
                    series: [
                        {
                            name: '2011年',
                            type: 'bar',
                            data: [18203, 23489, 29034, 104970, 131744, 630230]
                        },
                        {
                            name: '2012年',
                            type: 'bar',
                            data: [19325, 23438, 31000, 121594, 134141, 681807]
                        }
                    ]
                },
                option3: {
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                            type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                        }
                    },
                    legend: {
                        data: ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎', '百度', '谷歌', '必应', '其他']
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: [
                        {
                            type: 'category',
                            data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: [
                        {
                            name: '直接访问',
                            type: 'bar',
                            data: [320, 332, 301, 334, 390, 330, 320]
                        },
                        {
                            name: '邮件营销',
                            type: 'bar',
                            stack: '广告',
                            data: [120, 132, 101, 134, 90, 230, 210]
                        },
                        {
                            name: '联盟广告',
                            type: 'bar',
                            stack: '广告',
                            data: [220, 182, 191, 234, 290, 330, 310]
                        },
                        {
                            name: '视频广告',
                            type: 'bar',
                            stack: '广告',
                            data: [150, 232, 201, 154, 190, 330, 410]
                        },
                        {
                            name: '搜索引擎',
                            type: 'bar',
                            data: [862, 1018, 964, 1026, 1679, 1600, 1570],
                            markLine: {
                                lineStyle: {
                                    type: 'dashed'
                                },
                                data: [
                                    [{type: 'min'}, {type: 'max'}]
                                ]
                            }
                        },
                        {
                            name: '百度',
                            type: 'bar',
                            barWidth: 5,
                            stack: '搜索引擎',
                            data: [620, 732, 701, 734, 1090, 1130, 1120]
                        },
                        {
                            name: '谷歌',
                            type: 'bar',
                            stack: '搜索引擎',
                            data: [120, 132, 101, 134, 290, 230, 220]
                        },
                        {
                            name: '必应',
                            type: 'bar',
                            stack: '搜索引擎',
                            data: [60, 72, 71, 74, 190, 130, 110]
                        },
                        {
                            name: '其他',
                            type: 'bar',
                            stack: '搜索引擎',
                            data: [62, 82, 91, 84, 109, 110, 120]
                        }
                    ]
                },
                option2: {
                    tooltip: {
                        trigger: 'item',
                        formatter: '{a} <br/>{b}: {c} ({d}%)'
                    },
                    legend: {
                        orient: 'vertical',
                        left: 0,
                        data: ['小学', '初中', '高中']
                    },
                    series: [
                        {
                            name: '访问来源',
                            type: 'pie',
                            radius: ['50%', '70%'],
                            avoidLabelOverlap: false,
                            label: {
                                show: false,
                                position: 'center'
                            },
                            emphasis: {
                                label: {
                                    show: true,
                                    fontSize: '30',
                                    fontWeight: 'bold'
                                }
                            },
                            labelLine: {
                                show: false
                            },
                            data: [
                                {value: 335, name: '小学'},
                                {value: 310, name: '初中'},
                                {value: 234, name: '高中'},
                            ]
                        }
                    ]
                },
                radio: '1',
                option: {
                    xAxis: {
                        type: 'category',
                        data: ['9月', '10月', '11月', '12月', '1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月']
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: [{
                        data: [0, 50, 100, 150, 200, 250, 300],
                        type: 'line'
                    }]
                },
                value: [],
                options: [{
                    value: 'zhinan',
                    label: '指南',
                    children: [{
                        value: 'shejiyuanze',
                        label: '设计原则',
                        children: [{
                            value: 'yizhi',
                            label: '一致'
                        }, {
                            value: 'fankui',
                            label: '反馈'
                        }, {
                            value: 'xiaolv',
                            label: '效率'
                        }, {
                            value: 'kekong',
                            label: '可控'
                        }]
                    }, {
                        value: 'daohang',
                        label: '导航',
                        children: [{
                            value: 'cexiangdaohang',
                            label: '侧向导航'
                        }, {
                            value: 'dingbudaohang',
                            label: '顶部导航'
                        }]
                    }]
                }, {
                    value: 'zujian',
                    label: '组件',
                    children: [{
                        value: 'basic',
                        label: 'Basic',
                        children: [{
                            value: 'layout',
                            label: 'Layout 布局'
                        }, {
                            value: 'color',
                            label: 'Color 色彩'
                        }, {
                            value: 'typography',
                            label: 'Typography 字体'
                        }, {
                            value: 'icon',
                            label: 'Icon 图标'
                        }, {
                            value: 'button',
                            label: 'Button 按钮'
                        }]
                    }, {
                        value: 'form',
                        label: 'Form',
                        children: [{
                            value: 'radio',
                            label: 'Radio 单选框'
                        }, {
                            value: 'checkbox',
                            label: 'Checkbox 多选框'
                        }, {
                            value: 'input',
                            label: 'Input 输入框'
                        }, {
                            value: 'input-number',
                            label: 'InputNumber 计数器'
                        }, {
                            value: 'select',
                            label: 'Select 选择器'
                        }, {
                            value: 'cascader',
                            label: 'Cascader 级联选择器'
                        }, {
                            value: 'switch',
                            label: 'Switch 开关'
                        }, {
                            value: 'slider',
                            label: 'Slider 滑块'
                        }, {
                            value: 'time-picker',
                            label: 'TimePicker 时间选择器'
                        }, {
                            value: 'date-picker',
                            label: 'DatePicker 日期选择器'
                        }, {
                            value: 'datetime-picker',
                            label: 'DateTimePicker 日期时间选择器'
                        }, {
                            value: 'upload',
                            label: 'Upload 上传'
                        }, {
                            value: 'rate',
                            label: 'Rate 评分'
                        }, {
                            value: 'form',
                            label: 'Form 表单'
                        }]
                    }, {
                        value: 'data',
                        label: 'Data',
                        children: [{
                            value: 'table',
                            label: 'Table 表格'
                        }, {
                            value: 'tag',
                            label: 'Tag 标签'
                        }, {
                            value: 'progress',
                            label: 'Progress 进度条'
                        }, {
                            value: 'tree',
                            label: 'Tree 树形控件'
                        }, {
                            value: 'pagination',
                            label: 'Pagination 分页'
                        }, {
                            value: 'badge',
                            label: 'Badge 标记'
                        }]
                    }, {
                        value: 'notice',
                        label: 'Notice',
                        children: [{
                            value: 'alert',
                            label: 'Alert 警告'
                        }, {
                            value: 'loading',
                            label: 'Loading 加载'
                        }, {
                            value: 'message',
                            label: 'Message 消息提示'
                        }, {
                            value: 'message-box',
                            label: 'MessageBox 弹框'
                        }, {
                            value: 'notification',
                            label: 'Notification 通知'
                        }]
                    }, {
                        value: 'navigation',
                        label: 'Navigation',
                        children: [{
                            value: 'menu',
                            label: 'NavMenu 导航菜单'
                        }, {
                            value: 'tabs',
                            label: 'Tabs 标签页'
                        }, {
                            value: 'breadcrumb',
                            label: 'Breadcrumb 面包屑'
                        }, {
                            value: 'dropdown',
                            label: 'Dropdown 下拉菜单'
                        }, {
                            value: 'steps',
                            label: 'Steps 步骤条'
                        }]
                    }, {
                        value: 'others',
                        label: 'Others',
                        children: [{
                            value: 'dialog',
                            label: 'Dialog 对话框'
                        }, {
                            value: 'tooltip',
                            label: 'Tooltip 文字提示'
                        }, {
                            value: 'popover',
                            label: 'Popover 弹出框'
                        }, {
                            value: 'card',
                            label: 'Card 卡片'
                        }, {
                            value: 'carousel',
                            label: 'Carousel 走马灯'
                        }, {
                            value: 'collapse',
                            label: 'Collapse 折叠面板'
                        }]
                    }]
                }, {
                    value: 'ziyuan',
                    label: '资源',
                    children: [{
                        value: 'axure',
                        label: 'Axure Components'
                    }, {
                        value: 'sketch',
                        label: 'Sketch Templates'
                    }, {
                        value: 'jiaohu',
                        label: '组件交互文档'
                    }]
                }],
            }
        },
        methods: {
            handleChange(value) {
                console.log(value);
            }
        }
    }
</script>
<style lang="less">
    .header {
        display: flex;
        font-size: 20px;
        margin-top: 20px;
        margin-left: 20px;
    }

    .title {
        text-align: center;
        line-height: 40px;
        margin-right: 20px;
        font-size: 20px;
    }

    .progress-bar {
        width: 350px;
        margin-top: 100px;
        margin-left: 30px;

        .text {
            height: 26px;
            color: rgba(128, 128, 128, 1);
            font-size: 18px;
            margin-top: 50px;
            text-align: center;
        }
    }

    .content-line1 {
        display: flex;
        justify-content: space-between;
    }

    .content-line3 {
        display: flex;
    }

    .complete-the-number {
        margin-left: 30px;

        .text {
            height: 26px;
            color: rgba(128, 128, 128, 1);
            font-size: 18px;
            text-align: center;
        }
    }

    .participation {
        font-size: 20px;
        display: flex;
    }

    .option {
        margin-left: 50px;
        margin-top: 30px;
    }

    .coverage {
        margin-left: 500px;

        .title {
            text-align: center;
            margin-top: 30px;
        }

        .coverage-item {
            margin-top: 30px;
            width: 500px;
            display: flex;
            justify-content: space-evenly;
            text-align: center;

            .text {
                margin-top: 150px;
                margin-left: -130px;
            }
        }
    }

    .content-line5 {
        .option {
            margin-top: 20px;
            margin-bottom: -20px;
        }
    }
</style>
